package com.breakfast.fun.ui.user.address;

import com.breakfast.fun.data.entity.user.address.Building;
import com.breakfast.fun.data.entity.user.address.Road;
import com.breakfast.fun.util.Api;
import com.breakfast.fun.util.RxSchedulers;

import java.util.Map;

import retrofit2.http.FieldMap;
import rx.Observable;

/**
 * Created by yukai on 16/9/15.
 */
public class ChooseBuildingModel implements ChooseBuildingContract.Model {

    @Override
    public Observable<Road> getRoadModel(@FieldMap Map<String, String> map) {
        return Api.getInstance().service
                .getRoadModel(map)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<Building> getBuildingModel(@FieldMap Map<String, String> map) {
        return Api.getInstance().service
                .getBuildingModel(map)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<Building> getSearchBuildingModel(@FieldMap Map<String, String> map) {
        return Api.getInstance().service
                .getSearchBuildingModel(map)
                .compose(RxSchedulers.io_main());
    }
}
